package jblip.gui.data.channels;

import java.util.Enumeration;

import jblip.gui.JBlip;
import jblip.resources.Update;

public class TagDataChannel extends UpdatesDataChannel {
  private final String tag_name;

  TagDataChannel(final String tag) {
    super("#" + tag);
    this.tag_name = tag;
  }

  public String getTagName() {
    return tag_name;
  }

  @Override
  protected synchronized Enumeration<? extends Update> getUpdates() {
    return JBlip.instance().getBlipClient().pollTag(tag_name, null, null, null);
  }

  @Override
  protected Enumeration<? extends Update> getUpdates(final int last_update_id) {
    return JBlip.instance().getBlipClient().pollTag(
        tag_name, last_update_id, null, null);
  }

}
